package com;

import sun.jdbc.rowset.CachedRowSet;
import util.mysql;
import util.oracle;

public class xt_xtyh {
	public static void main(String args[]) {
		oracle o = new oracle();
		mysql m = new mysql();
		try {
			int all = 0;
			long start = System.currentTimeMillis();
			CachedRowSet rs = o.executeQuery("select * from xt_xtyh");
			while (rs.next()) {
				String sql = "insert into xt_xtyh values(";
				for (int i = 1; i <= 54; i++) {

					sql += get(rs.getString(i)) + ((i == 54) ? "" : ",");

				}
				sql += ")";
				m.execute(sql);
			}
			System.err.println("用时：" + (System.currentTimeMillis() - start));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static String get(String s) {
		if (s == null || s.trim().equalsIgnoreCase("null")) {
			return null;
		} else {
			return "'" + s.replaceAll("'", "''") + "'";
		}
	}
}
